/* ═══ Masthead ═══════════════════════════════════════════════════════════
   7 / 5. Name and record on the left, the photograph placed on the sheet.  */

.mast {
  display: flex;
  align-items: center;
  min-height: calc(100svh - 64px);
  padding-block: clamp(2.5rem, 1.5rem + 3.5vw, 5rem) clamp(3rem, 2rem + 4vw, 6rem);
}

.mast__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: end;
  width: 100%;
}

.mast__body { grid-column: 1 / 8; }

/* ── Nameplate ─────────────────────────────────────────────────────────
   Hairline, name, heavy rule, role. Three rule weights inside one block is
   what makes a printed sheet read as a title rather than as a headline.  */

.nameplate {
  border-top: var(--rule-hair) solid var(--rule);
  padding-top: clamp(0.7rem, 0.5rem + 0.6vw, 1rem);
}

.mast__name {
  font-size: var(--t-800);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 0.9;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.mast__role {
  margin-top: clamp(0.8rem, 0.6rem + 0.7vw, 1.2rem);
  padding-top: clamp(0.7rem, 0.55rem + 0.5vw, 1rem);
  border-top: var(--rule-plate) solid var(--rule-strong);
  font-size: var(--t-500);
  font-weight: 600;
  font-stretch: 108%;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.mast__lead {
  max-width: 38ch;
  margin-top: clamp(1.1rem, 0.8rem + 1.2vw, 1.75rem);
  font-size: var(--t-500);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.012em;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ── Issue register · the masthead's identifying data ─────────────────── */

.issue {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
  gap: 1.1rem 1.75rem;
  margin-top: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  padding-top: 1.1rem;
  border-top: var(--rule-mid) solid var(--rule-strong);
}

.issue__field dt {
  font-size: var(--t-100);
  font-weight: 600;
  font-stretch: 106%;
  color: var(--ink-3);
  margin-bottom: 0.3rem;
}

.issue__field dd {
  font-size: var(--t-200);
  font-weight: 500;
  line-height: 1.35;
  text-wrap: pretty;
}

/* The one filled surface on the page. An Eingangsstempel is struck onto the
   sheet, not drawn beside it, and this is the single fact a recruiter is
   looking for. Paper on stamp measures 5.98:1, above AA. */
.stamp {
  display: inline-block;
  padding: 0.3rem 0.7rem 0.34rem;
  background: var(--stamp);
  color: var(--paper);
  font-weight: 600;
  font-stretch: 104%;
  letter-spacing: -0.005em;
}

.mast__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
}

/* ── Portrait · a document photograph, square-cornered ────────────────── */

.portrait {
  position: relative;
  grid-column: 9 / 13;
  aspect-ratio: 4 / 5;
  background: var(--paper-2);
  box-shadow: 0 14px 34px -18px rgba(22, 26, 33, 0.45);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait__fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: var(--t-700);
  font-weight: 700;
  font-stretch: 116%;
  color: var(--ink-3);
  letter-spacing: -0.02em;
}

.portrait--empty { box-shadow: none; outline: 1px solid var(--rule); }
.portrait--empty img { display: none; }
.portrait--empty .portrait__fallback { display: flex; }

@media (max-width: 900px) {
  .mast { min-height: 0; }
  .mast__grid { align-items: start; }
  .mast__body { grid-column: 1 / 13; order: 2; }
  .portrait {
    grid-column: 1 / 7;
    order: 1;
    aspect-ratio: 3 / 2;
    margin-bottom: 0.5rem;
  }
  .mast__lead { max-width: var(--measure-narrow); }
}

@media (max-width: 560px) {
  /* The photograph is cropped to a band so the name, the record and both
     actions still land inside the first screen. Framed above centre because
     the subject sits in the upper half of the source image. */
  .mast {
    padding-block: 1.5rem 2.5rem;
  }
  .portrait {
    grid-column: 1 / 13;
    aspect-ratio: 16 / 9;
    max-height: 25svh;
  }
  .portrait img { object-position: center 28%; }
  .mast__lead { font-size: var(--t-400); }

  /* Two fields share a row so the register costs two lines instead of three
     and both actions stay inside the first screen. */
  .issue {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1.25rem;
    margin-top: 1.4rem;
  }
  .issue__field--stamp { grid-column: 1 / -1; }

  .mast__actions { margin-top: 1.4rem; }
  .mast__actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ═══ Fachschwerpunkte · the module register ═════════════════════════════
   A label column and a prose column, hairline-separated. This replaces the
   card grid entirely, and the rows are deliberately unequal: MM is the
   current focus and is given the weight to match.                          */

.reg__row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 0.75rem var(--gutter);
  border-top: var(--rule-hair) solid var(--rule);
  padding-block: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
}

.reg__row--lead {
  border-top-width: var(--rule-mid);
  border-top-color: var(--rule-strong);
  padding-bottom: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
}

.reg__key {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* The module codes are the section's rhythm and its second point of scale
   after the name. Set at poster size, they also give the left column a job:
   before, it was 300px of nothing. */
.reg__code {
  font-size: var(--t-code);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 0.86;
  letter-spacing: -0.038em;
}

.reg__row--lead .reg__code { font-size: var(--t-code-lead); }

.reg__sub {
  font-size: var(--t-100);
  color: var(--ink-3);
  line-height: 1.35;
}

/* The measure sits on the paragraphs, not on this container. `ch` resolves
   against the element's own font-size, and the lead row mixes two sizes, so a
   measure set here would let the smaller paragraph run to 90+ characters. */
.reg__val {
  color: var(--ink-2);
}

.reg__val p { max-width: var(--measure); }

.reg__val p + p { margin-top: 0.85rem; }

.reg__row--lead .reg__val {
  color: var(--ink);
  font-size: var(--t-400);
  line-height: 1.5;
}

.reg__row--lead .reg__val p + p {
  color: var(--ink-2);
  font-size: var(--t-300);
  line-height: 1.6;
}

@media (max-width: 720px) {
  .reg__row { grid-template-columns: 1fr; }
  .reg__key { flex-direction: row; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
}

/* ── Technische Umsetzung · a denser band, a different layout family ──── */

.tech {
  margin-top: clamp(3rem, 2rem + 4vw, 5rem);
}

.tech__title {
  font-size: var(--t-400);
  font-weight: 600;
  font-stretch: 108%;
  letter-spacing: -0.015em;
  margin-bottom: 1.5rem;
}

.tech__grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1.15fr 1fr;
  gap: var(--gutter);
}

.tech__item {
  border-top: 1px solid var(--rule);
  padding-top: 0.9rem;
}

.tech__item h4 {
  font-size: var(--t-300);
  font-weight: 700;
  font-stretch: 108%;
  letter-spacing: -0.012em;
  margin-bottom: 0.45rem;
}

.tech__item p {
  font-size: var(--t-200);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

@media (max-width: 900px) {
  .tech__grid { grid-template-columns: 1fr 1fr; gap: 1.75rem var(--gutter); }
}

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

/* ═══ Werdegang · the time axis ══════════════════════════════════════════
   A date rail, a continuous 1px axis, and entries that hang off it. The
   completed projects live inside their entry as short facts, not as a
   separate case-study section.                                             */

.time__entry {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 9.6fr);
  gap: 0.9rem var(--gutter);
  border-top: 1px solid var(--rule);
  padding-top: clamp(1.35rem, 1rem + 1.2vw, 1.9rem);
  padding-bottom: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
}

.time__entry--now { border-top: 2px solid var(--rule-strong); }

.time__rail {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: start;
}

/* The date is this section's left-column anchor, the way the module code is
   the register's. Both columns now carry weight instead of holding space. */
.time__date {
  font-size: var(--t-500);
  font-weight: 700;
  font-stretch: 110%;
  line-height: 1;
  letter-spacing: -0.022em;
  white-space: nowrap;
}

.time__flag {
  font-size: var(--t-100);
  font-weight: 600;
  color: var(--ink-3);
}

.time__entry--now .time__flag { color: var(--stamp-deep); }

.time__body {
  border-left: 1px solid var(--rule);
  padding-left: clamp(1.1rem, 0.8rem + 1.2vw, 2rem);
}

.time__entry--now .time__body { border-left-color: var(--stamp); }

.time__org {
  font-size: var(--t-600);
  font-weight: 700;
  font-stretch: 110%;
  line-height: 1.05;
  letter-spacing: -0.026em;
}

.time__role {
  max-width: 52ch;
  margin-top: 0.35rem;
  font-size: var(--t-300);
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.45;
}

.time__text {
  max-width: var(--measure);
  margin-top: 1.1rem;
  color: var(--ink-2);
  text-wrap: pretty;
}

.time__facts {
  max-width: var(--measure);
  margin-top: 1.35rem;
  display: grid;
  gap: 0.7rem;
}

.time__facts li {
  position: relative;
  padding-left: 1.35rem;
  font-size: var(--t-200);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

.time__facts li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.7rem;
  height: 1px;
  background: var(--ink-3);
}

/* ── Grades · stated at their real value ─────────────────────────────── */

.grades {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.grades dt {
  font-size: var(--t-100);
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 0.15rem;
}

.grades dd {
  font-size: var(--t-400);
  font-weight: 600;
  font-stretch: 106%;
  letter-spacing: -0.015em;
}

@media (max-width: 720px) {
  .time__entry { grid-template-columns: 1fr; }
  .time__rail { flex-direction: row; align-items: baseline; gap: 0.75rem; }
  .time__body { border-left: none; padding-left: 0; }
  .time__entry--now .time__body {
    border-left: 1px solid var(--stamp);
    padding-left: 1.1rem;
  }
}

/* ═══ Nachweise · the Verzeichnis ════════════════════════════════════════ */

.verz {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.verz thead th {
  border-bottom: 2px solid var(--rule-strong);
  padding-bottom: 0.7rem;
  font-size: var(--t-100);
  font-weight: 600;
  font-stretch: 106%;
  color: var(--ink-3);
}

.verz tbody th,
.verz tbody td {
  border-top: 1px solid var(--rule);
  padding-block: clamp(1rem, 0.8rem + 0.8vw, 1.4rem);
  padding-right: var(--gutter);
  vertical-align: baseline;
  font-weight: 400;
  color: var(--ink-2);
}

.verz tbody th {
  font-size: var(--t-400);
  font-weight: 600;
  font-stretch: 106%;
  letter-spacing: -0.015em;
  color: var(--ink);
  width: 46%;
}

.verz__sub {
  display: block;
  margin-top: 0.2rem;
  font-size: var(--t-100);
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: 0;
  color: var(--ink-3);
}

.verz__num { white-space: nowrap; }

.verz__act {
  text-align: right;
  padding-right: 0 !important;
  white-space: nowrap;
}

.verz__act a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--ink);
}

.verz__note { color: var(--ink-3); font-size: var(--t-200); }

.badges {
  margin-top: clamp(2.5rem, 1.8rem + 2.5vw, 3.75rem);
}

.badges__title {
  font-size: var(--t-400);
  font-weight: 600;
  font-stretch: 108%;
  letter-spacing: -0.015em;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  margin-bottom: 1.5rem;
}

.badges__row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  min-height: 270px;
}

.badges__row > div { flex: 0 0 auto; }

@media (max-width: 640px) {
  .verz thead { display: none; }
  .verz tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.15rem 1rem;
    border-top: 1px solid var(--rule);
    padding-block: 1.1rem;
  }
  .verz tbody th,
  .verz tbody td { border-top: none; padding-block: 0; width: auto; }
  .verz tbody th { grid-column: 1 / 2; }
  .verz__act { grid-row: 1 / 2; grid-column: 2 / 3; }
  .verz__num { font-size: var(--t-100); color: var(--ink-3); }
}

/* ═══ Zur Person · the quiet passage ═════════════════════════════════════
   The dense registers above earn this. One column, offset, real prose.     */

.person {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 var(--gutter);
}

.person .sec__head { grid-column: 1 / 13; }

.person__text {
  grid-column: 3 / 10;
  max-width: var(--measure);
  font-size: var(--t-400);
  line-height: 1.6;
  text-wrap: pretty;
}

.person__text p + p { margin-top: 1.25rem; }

.facts {
  grid-column: 10 / 13;
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

.facts dt {
  font-size: var(--t-100);
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 0.3rem;
}

.facts dd {
  font-size: var(--t-200);
  font-weight: 500;
  line-height: 1.45;
}

@media (max-width: 1000px) {
  .person__text { grid-column: 1 / 9; }
  .facts { grid-column: 10 / 13; }
}

@media (max-width: 760px) {
  .person__text { grid-column: 1 / 13; }
  .facts {
    grid-column: 1 / 13;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 1.25rem;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 520px) {
  .facts { grid-auto-flow: row; }
}
