/* Portfolio — Komponenten-Stylesheet. Alle Werte kommen aus tokens.css (var(--…)).
   Laden: tokens.css, dann diese Datei. Klassenpräfix: pf-. */

:root {
  --dur-fast: 120ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; }

::selection { background: var(--ink); color: var(--ink-inverse); }

:focus-visible {
  outline: var(--stroke-strong) solid var(--focus);
  outline-offset: 3px;
}
.pf-inverse :focus-visible { outline-color: var(--focus-inverse); }

/* Type helpers (the sizes themselves come from tokens.css classes: .display-xl, .ui, .meta …) */
.meta, .pf-tnum { font-variant-numeric: tabular-nums; }
.pf-muted { color: var(--ink-muted); }

/* Surfaces */
.pf-inverse {
  background: var(--surface-inverse);
  color: var(--ink-inverse);
}
.pf-inverse .pf-muted { color: var(--ink-inverse-muted); }

.pf-container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--page-margin);
}

/* ---------- Link ---------- */
.pf-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: var(--stroke-hair);
  text-underline-offset: 0.2em;
}
.pf-link:hover { text-decoration-thickness: var(--stroke-strong); }
.pf-link--quiet { text-decoration-color: transparent; }
.pf-link--quiet:hover,
.pf-link--quiet[aria-current="page"] { text-decoration-color: currentColor; }
.pf-link[aria-current="page"] { text-decoration-thickness: var(--stroke-strong); }

/* ---------- Button ---------- */
.pf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border: var(--stroke-hair) solid var(--line);
  border-radius: var(--radius-none);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.pf-button:hover { background: var(--surface-inverse); color: var(--ink-inverse); }
.pf-button--solid { background: var(--surface-inverse); color: var(--ink-inverse); }
.pf-button--solid:hover { background: transparent; color: var(--ink); }
.pf-button--text {
  padding: 0;
  border-color: transparent;
  text-decoration: underline;
  text-decoration-thickness: var(--stroke-hair);
  text-underline-offset: 0.2em;
}
.pf-button--text:hover { background: transparent; color: var(--ink); text-decoration-thickness: var(--stroke-strong); }
.pf-button[aria-disabled="true"],
.pf-button:disabled {
  border-color: var(--line-subtle);
  background: transparent;
  color: var(--ink-muted);
  cursor: not-allowed;
}
.pf-button--text[aria-disabled="true"] { border-color: transparent; }

/* ---------- Theme toggle ---------- */
.pf-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
}
.pf-theme-toggle svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; }
.pf-theme-toggle:hover span { text-decoration: underline; text-decoration-thickness: var(--stroke-hair); text-underline-offset: 0.2em; }

/* ---------- Navigation ---------- */
.pf-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-1) var(--page-margin);
}
.pf-nav__name { justify-self: start; text-decoration: none; }
.pf-nav__links { display: flex; gap: var(--space-5); }
.pf-nav__links a,
.pf-nav__name {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.pf-nav__end { justify-self: end; }

/* ---------- Hero ---------- */
.pf-hero {
  display: flex;
  align-items: flex-end;
  gap: var(--space-5);
  padding: var(--space-9) var(--page-margin) var(--space-6);
}
.pf-hero__title {
  font-size: clamp(88px, 15.5vw, 224px);
}
.pf-hero__note {
  max-width: 22ch;
  padding-bottom: 0.5em;
}

/* ---------- Work index ---------- */
.pf-index { border-top: var(--stroke-hair) solid var(--line); }
.pf-index__row {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-5);
  padding: var(--space-4) var(--page-margin);
  border-bottom: var(--stroke-hair) solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.pf-index__no, .pf-index__year { font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.pf-index__kind { color: var(--ink-muted); }
.pf-index__row:hover { background: var(--surface-inverse); color: var(--ink-inverse); }
.pf-index__row:hover .pf-index__no,
.pf-index__row:hover .pf-index__year,
.pf-index__row:hover .pf-index__kind { color: var(--ink-inverse-muted); }
.pf-index__row:focus-visible { outline-offset: -4px; }

/* ---------- Project card ---------- */
.pf-card { display: block; color: var(--ink); text-decoration: none; }
.pf-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-sunken);
  overflow: hidden;
}
.pf-card__media img { width: 100%; height: 100%; object-fit: cover; }
.pf-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--stroke-strong) solid var(--ink);
  opacity: 0;
  pointer-events: none;
}
.pf-card:hover .pf-card__media::after { opacity: 1; }
.pf-card__ph {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-3);
  color: var(--ink-muted);
}
.pf-card__caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  padding-top: var(--space-3);
}
.pf-card__year { font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.pf-card:hover .pf-card__title { text-decoration: underline; text-decoration-thickness: var(--stroke-hair); text-underline-offset: 0.2em; }

/* ---------- Field ---------- */
.pf-field { display: grid; gap: var(--space-2); }
.pf-field__control {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  border: var(--stroke-hair) solid var(--line);
  border-radius: var(--radius-none);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  appearance: none;
}
textarea.pf-field__control { min-height: 160px; resize: vertical; }
.pf-field__control::placeholder { color: var(--ink-muted); opacity: 1; }
.pf-field__control:hover { background: var(--surface-sunken); }
.pf-field__control:focus-visible { outline-offset: 2px; }
.pf-field__control[aria-invalid="true"] { border: var(--stroke-strong) solid var(--error); padding: calc(var(--space-3) - 1px) calc(var(--space-4) - 1px); }
.pf-field__hint { color: var(--ink-muted); }
.pf-field__error { color: var(--error); }

/* ---------- Footer ---------- */
.pf-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-7) var(--space-8);
  padding: var(--space-7) var(--page-margin) var(--space-5);
  border-top: var(--stroke-hair) solid var(--line);
}
.pf-footer__lead { display: grid; gap: var(--space-2); align-content: start; }
.pf-footer__mail {
  font-size: clamp(40px, 6.1vw, 88px);
  text-decoration: underline;
  text-decoration-thickness: var(--stroke-hair);
  text-underline-offset: 0.12em;
  overflow-wrap: anywhere;
}
.pf-footer__mail:hover { text-decoration-thickness: var(--stroke-strong); }
.pf-footer__links { display: grid; gap: 0; align-content: start; }
.pf-footer__links a { display: inline-flex; align-items: center; min-height: 32px; }
.pf-footer__legal {
  grid-column: 1 / -1;
  padding-top: var(--space-4);
  border-top: var(--stroke-hair) solid var(--line-subtle);
}
.pf-footer.pf-inverse { border-top-color: var(--surface-inverse); }
.pf-footer.pf-inverse .pf-footer__legal { border-top-color: var(--ink-inverse-muted); }

/* ---------- Auf umgekehrten Flächen (.pf-inverse) ---------- */
.pf-inverse ::selection { background: var(--ink-inverse); color: var(--surface-inverse); }
.pf-inverse .pf-button { border-color: var(--ink-inverse); color: var(--ink-inverse); }
.pf-inverse .pf-button:hover { background: var(--ink-inverse); color: var(--surface-inverse); }
.pf-inverse .pf-button--solid { background: var(--ink-inverse); color: var(--surface-inverse); }
.pf-inverse .pf-button--solid:hover { background: transparent; color: var(--ink-inverse); }
.pf-inverse .pf-button--text { border-color: transparent; }
.pf-inverse .pf-button--text:hover { background: transparent; color: var(--ink-inverse); }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  :root { --page-margin: 16px; }
  .pf-nav { grid-template-columns: 1fr auto; row-gap: 0; }
  .pf-nav__links { grid-column: 1 / -1; grid-row: 2; gap: var(--space-5); }
  .pf-hero { flex-direction: column; align-items: flex-start; padding-top: var(--space-8); }
  .pf-hero__note { padding-bottom: 0; }
  .pf-index__row { grid-template-columns: 2.5rem minmax(0, 1fr) auto; row-gap: var(--space-1); }
  .pf-index__title { font-size: 24px; }
    .pf-index__kind { grid-column: 2; grid-row: 2; }
  .pf-index__year { grid-column: 3; grid-row: 1; }
  .pf-footer { grid-template-columns: 1fr; }
}
