:root {
  --ink: #14202b;
  --ink-muted: #536273;
  --navy-950: #071826;
  --navy-900: #0b2235;
  --navy-800: #12344d;
  --teal-600: #087f8c;
  --teal-500: #12a0ad;
  --teal-100: #dff3f4;
  --blue-100: #eaf1f6;
  --line: #d7e0e7;
  --surface: #f4f7f9;
  --paper: #fff;
  --sans: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #dfe5ea;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 10.5pt;
  line-height: 1.58;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.cover {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 8vh 8vw 7vh;
  color: #fff;
  background:
    radial-gradient(circle at 78% 20%, rgba(18, 160, 173, 0.24), transparent 25%),
    linear-gradient(135deg, var(--navy-950), var(--navy-900) 58%, #11465a);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.cover::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 31%;
  height: 100%;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.cover::after {
  content: "";
  position: absolute;
  right: -15vw;
  bottom: -25vw;
  width: 52vw;
  height: 52vw;
  border: 1px solid rgba(255, 255, 255, 0.17);
  transform: rotate(45deg);
}

.cover-grid {
  position: absolute;
  inset: 0;
  opacity: 0.065;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.8) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.8) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(120deg, #000, transparent 68%);
}

.cover-brand,
.cover-content,
.cover-meta {
  position: relative;
  z-index: 1;
}

.cover-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  font-size: 9pt;
  letter-spacing: 0.04em;
}

.cover-content {
  position: relative;
  align-self: center;
  max-width: 780px;
}

.cover-photo {
  position: absolute;
  top: 50%;
  left: min(62vw, 760px);
  width: clamp(190px, 22vw, 310px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  transform: translateY(-50%);
}

.eyebrow,
.chapter-kicker {
  margin: 0 0 15px;
  color: var(--teal-500);
  font-size: 7.7pt;
  font-weight: 750;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.cover h1 {
  margin: 0;
  color: #fff;
  font-family: var(--sans);
  font-size: clamp(54px, 8.2vw, 96px);
  font-weight: 690;
  letter-spacing: -0.06em;
  line-height: 0.88;
}

.cover-role {
  margin: 32px 0 0;
  font-size: clamp(20px, 2.8vw, 32px);
  font-weight: 350;
  line-height: 1.18;
  letter-spacing: -0.018em;
}

.cover-role span {
  color: #88d5dc;
}

.cover-summary {
  max-width: 500px;
  margin: 25px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11.5pt;
  line-height: 1.55;
}

.cover-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 25px;
}

.cover-tags span {
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.04);
  font-size: 7.6pt;
  font-weight: 620;
  letter-spacing: 0.035em;
}

.cover-contact {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1px;
  max-width: 760px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.12);
  font-style: normal;
}

.cover-contact > div {
  padding: 12px 14px;
  background: rgba(7, 24, 38, 0.68);
}

.cover-contact .contact-label {
  display: block;
  margin-bottom: 4px;
  color: #76ccd5;
  font-size: 6.6pt;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cover-contact strong,
.cover-contact a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 8.1pt;
  font-weight: 560;
  line-height: 1.4;
  text-decoration: none;
}

.cover-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.17);
}

.cover-meta span,
.cover-meta strong {
  display: block;
}

.cover-meta span {
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 7pt;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.cover-meta strong {
  font-size: 9pt;
  font-weight: 560;
}

main {
  max-width: 1060px;
  margin: 0 auto;
}

.chapter {
  position: relative;
  min-height: 100vh;
  padding: 76px 84px 78px;
  overflow: hidden;
  background: var(--paper);
}

.chapter + .chapter {
  border-top: 1px solid var(--line);
}

.chapter::after {
  content: attr(data-chapter);
  position: absolute;
  top: 64px;
  right: 78px;
  z-index: 0;
  color: #e6edf1;
  font-size: 39pt;
  font-weight: 720;
  line-height: 1;
}

.chapter-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 31px;
  padding-bottom: 23px;
  border-bottom: 1px solid var(--line);
}

.chapter-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--teal-600);
  background: var(--teal-100);
}

.chapter-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chapter-header h1 {
  max-width: 83%;
  margin: 0;
  color: var(--navy-900);
  font-family: var(--display);
  font-size: 29pt;
  font-weight: 650;
  letter-spacing: -0.028em;
  line-height: 1.06;
}

.chapter-body {
  position: relative;
  z-index: 1;
}

.chapter h2 {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 27px 0 10px;
  color: var(--navy-800);
  font-size: 9.5pt;
  font-weight: 770;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.chapter h2::before {
  content: "";
  flex: 0 0 17px;
  height: 2px;
  background: var(--teal-500);
}

.chapter h3 {
  margin: 20px 0 7px;
  color: var(--teal-600);
  font-size: 10pt;
}

.chapter p {
  max-width: 75ch;
  margin: 0 0 11px;
  color: #263746;
  orphans: 3;
  widows: 3;
}

.chapter-body > p:first-child {
  color: var(--ink);
  font-size: 11.1pt;
  line-height: 1.55;
}

.chapter ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 25px;
  margin: 8px 0 17px;
  padding: 0;
  list-style: none;
}

.chapter li {
  position: relative;
  padding-left: 16px;
  color: #2a3b49;
  break-inside: avoid;
}

.chapter li::before {
  content: "";
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal-500);
}

.meta-table {
  display: block;
  width: 100%;
  margin: -4px 0 26px;
}

.meta-table tbody {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.meta-table tr {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 61px;
  padding: 11px 13px;
  background: var(--surface);
}

.meta-table td {
  display: block;
  padding: 0;
  border: 0;
}

.meta-table td:first-child {
  margin-bottom: 4px;
  color: var(--teal-600);
  font-size: 6.8pt;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.meta-table td:last-child {
  color: var(--navy-900);
  font-size: 8.6pt;
  font-weight: 640;
  line-height: 1.35;
}

.data-table {
  width: 100%;
  margin: 11px 0 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 8.5pt;
}

.data-table th {
  padding: 9px 11px;
  color: #fff;
  background: var(--navy-800);
  font-size: 7.2pt;
  font-weight: 730;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  padding: 8px 11px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.data-table tbody tr:nth-child(even) {
  background: var(--surface);
}

.section-ergebnis + p {
  position: relative;
  max-width: none;
  margin-top: 10px;
  padding: 17px 19px 17px 51px;
  border-left: 3px solid var(--teal-500);
  color: var(--navy-900);
  background: linear-gradient(90deg, var(--teal-100), #f6fbfb);
  font-weight: 540;
}

.section-ergebnis + p::before {
  content: "✓";
  position: absolute;
  top: 16px;
  left: 18px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  background: var(--teal-600);
  font-size: 8.5pt;
  font-weight: 800;
}

.section-technologieprofil + ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.section-technologieprofil + ul li {
  padding: 6px 9px;
  border: 1px solid #cfdbe2;
  color: var(--navy-800);
  background: var(--surface);
  font-size: 7.7pt;
  font-weight: 610;
}

.section-technologieprofil + ul li::before {
  display: none;
}

.project-chapter {
  border-top: 6px solid var(--navy-900);
}

.project-chapter .chapter-header {
  padding-right: 55px;
}

.toc {
  background:
    linear-gradient(90deg, var(--surface) 0, var(--surface) 28%, #fff 28%);
}

.toc::after {
  content: "00";
}

.toc-groups,
.toc-groups ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-group {
  margin-top: 20px;
}

.toc-group > span {
  display: block;
  margin-bottom: 4px;
  color: var(--teal-600);
  font-size: 7.1pt;
  font-weight: 760;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.toc li {
  padding: 0;
}

.toc li::before {
  display: none;
}

.toc a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.toc-number {
  flex: 0 0 25px;
  color: var(--teal-600);
  font-size: 7.8pt;
  font-weight: 760;
}

.toc-title {
  font-size: 9.4pt;
  font-weight: 580;
}

.toc-leader {
  flex: 1;
  border-bottom: 1px dotted #b6c2ca;
}

.screen-footer {
  display: flex;
  justify-content: space-between;
  max-width: 1060px;
  margin: 0 auto;
  padding: 23px 84px;
  color: var(--ink-muted);
  background: var(--surface);
  font-size: 8pt;
}

.screen-footer a {
  color: var(--teal-600);
  text-decoration: none;
}

@page {
  size: A4;
  margin: 15mm 17mm 17mm;

  @bottom-left {
    content: "LUKAS LUKOWSKI  ·  PROFESSIONAL PORTFOLIO";
    color: #667788;
    font-family: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 6.8pt;
    letter-spacing: 0.08em;
  }

  @bottom-right {
    content: "PAGE " counter(page);
    color: #667788;
    font-family: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 6.8pt;
  }
}

@page:first {
  margin: 0;

  @bottom-left {
    content: "";
  }

  @bottom-right {
    content: "";
  }
}

@media print {
  html,
  body {
    background: #fff;
  }

  body {
    font-size: 8.75pt;
    line-height: 1.45;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .cover {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    padding: 23mm 20mm 19mm;
    break-after: page;
    page-break-after: always;
  }

  .cover h1 {
    font-size: 55pt;
  }

  .cover-summary {
    font-size: 10.5pt;
  }

  .cover-contact {
    margin-top: 5mm;
  }

  main {
    max-width: none;
  }

  .chapter {
    min-height: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    break-before: page;
    page-break-before: always;
  }

  .chapter::after {
    top: 0;
    right: 0;
  }

  .chapter-header {
    margin-bottom: 7mm;
    padding-bottom: 5mm;
  }

  .chapter-header h1 {
    font-size: 24pt;
  }

  .chapter h2 {
    margin-top: 5.5mm;
    break-after: avoid;
    page-break-after: avoid;
  }

  .chapter h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  .chapter p {
    margin-bottom: 2.4mm;
  }

  .chapter li,
  .meta-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .meta-table,
  .data-table,
  .section-ergebnis + p,
  .section-technologieprofil + ul {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .toc {
    background: #fff;
  }

  .toc a {
    text-decoration: none;
  }

  .toc a::after {
    content: target-counter(attr(href), page);
    margin-left: 8px;
    color: var(--ink-muted);
    font-size: 7.5pt;
  }

  .screen-footer {
    display: none;
  }
}

@media screen and (max-width: 720px) {
  .cover {
    padding: 42px 28px 36px;
  }

  .cover-meta {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .cover-contact {
    grid-template-columns: 1fr;
  }

  .chapter {
    min-height: 0;
    padding: 50px 27px;
  }

  .chapter::after {
    top: 50px;
    right: 27px;
  }

  .chapter-header {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 15px;
  }

  .chapter-icon {
    width: 38px;
    height: 38px;
  }

  .chapter-header h1 {
    max-width: 90%;
    font-size: 24pt;
  }

  .chapter ul {
    grid-template-columns: 1fr;
  }

  .meta-table tbody {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screen-footer {
    padding: 20px 27px;
  }
}
