/* =====================================================================
   Lebenslauf (design: CV.dc.html)
   Password gate (state comes from the controller/session) and the CV:
   intro with portrait + print button, "Jetzt gerade" card, Stationen
   timeline, skill chips. Print styles for "Als PDF drucken".
   ===================================================================== */

/* ---- gate ---- */

@keyframes cv-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* brief tilt on the avatar while the form shakes, then settle back */
@keyframes cv-tilt {
  0%, 80% { transform: rotate(-6deg); }
  100% { transform: none; }
}

.cv-gate {
  /* fills the viewport minus the rough header + footer height, so the
     gate box sits visually centered without pushing the footer far down */
  min-height: calc(100dvh - 300px);
  display: grid;
  place-items: center;
  padding: 48px 24px 24px;
}

.cv-gate__box {
  width: 360px;
  max-width: 100%;
  text-align: center;
}

.cv-gate__avatar-wrap {
  position: relative;
  width: 120px;
  margin: 0 auto;
}

.cv-gate__avatar {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--card);
  box-shadow: 0 4px 16px rgba(60, 40, 20, .15);
}

.cv-gate__avatar.is-shaking {
  animation: cv-tilt .45s ease;
}

.cv-gate__emoji {
  position: absolute;
  right: -10px;
  bottom: 2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(60, 40, 20, .12);
}

.cv-gate__title {
  font-size: 22px;
  margin-top: 24px;
}

.cv-gate__text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--sub);
  margin: 8px 0 0;
  text-wrap: pretty;
}

.cv-gate__form {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.cv-gate__form.is-shaking {
  animation: cv-shake .4s ease;
}

.cv-gate__input {
  flex: 1;
  min-width: 0;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.cv-gate__input:focus {
  border-color: var(--accent);
}

.cv-gate__submit {
  flex: none;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--ink);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.cv-gate__submit:hover {
  box-shadow: 0 3px 10px rgba(60, 40, 20, .2);
}

.cv-gate__hint {
  font-size: 12px;
  color: var(--faint);
  margin-top: 14px;
  min-height: 18px;
}

/* ---- intro ---- */

.cv-intro {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin-top: 64px;
}

.cv-intro__portrait {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 3px solid var(--card);
  box-shadow: 0 2px 8px rgba(60, 40, 20, .12);
}

.cv-intro__text {
  min-width: 0;
  flex: 1;
}

.cv-intro__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.cv-intro h1 {
  font-size: 24px;
}

.cv-intro__role {
  font-size: 14px;
  color: var(--sub);
  margin-top: 3px;
}

.cv-intro__print {
  flex: none;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--body);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  transition: box-shadow .18s ease;
}

.cv-intro__print:hover {
  box-shadow: 0 2px 6px rgba(60, 40, 20, .12);
}

.cv-intro__bio {
  font-size: 15px;
  line-height: 1.7;
  color: var(--body);
  margin: 12px 0 0;
  text-wrap: pretty;
}

.cv-intro__links {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 12.5px;
  flex-wrap: wrap;
}

/* ---- "Jetzt gerade" card ---- */

.cv-now {
  margin-top: 40px;
  padding: 20px 24px;
}

.cv-now__head {
  display: flex;
  gap: 9px;
  align-items: center;
}

.cv-now__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: oklch(0.72 0.15 150);
  flex: none;
}

.cv-now__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
}

.cv-now__text {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--body);
  margin: 10px 0 0;
  text-wrap: pretty;
}

/* ---- stationen ---- */

.cv-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.cv-stationen {
  margin-top: 52px;
}

.cv-stationen__list {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
}

.cv-station {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.cv-station__period {
  font-size: 12.5px;
  color: var(--faint);
  padding-top: 2px;
  white-space: nowrap;
}

.cv-station__body {
  min-width: 0;
}

.cv-station__head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.cv-station__role {
  font-size: 15.5px;
  font-weight: 700;
}

.cv-station__org {
  font-size: 13px;
  color: var(--sub);
}

.cv-station__text {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--body);
  margin: 7px 0 0;
  text-wrap: pretty;
}

/* ---- skills ---- */

.cv-skills {
  margin-top: 52px;
}

.cv-skills__list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 16px;
}

.cv-skillgroup {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  align-items: baseline;
}

.cv-skillgroup__name {
  font-size: 12.5px;
  color: var(--faint);
  white-space: nowrap;
}

.cv-skillgroup__body {
  min-width: 0;
}

.cv-skillgroup__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cv-skillgroup__text {
  font-size: 13px;
  line-height: 1.65;
  color: var(--sub);
  margin: 8px 0 0;
  text-wrap: pretty;
}

.cv-skillgroup__chip {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--body);
}

/* ---- "Wieder sperren" ---- */

.cv-lock {
  margin-top: 72px;
  text-align: right;
}

.cv-lock button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--faint);
}

.cv-lock button:hover {
  color: var(--sub);
}

/* ---- print ("Als PDF drucken") ---- */

@media print {
  /* print is always light — with print-color-adjust the active theme
     (e.g. "Dunkel") would flood the pages with dark ink; a neutral
     paper palette overrides all theme variables instead */
  :root,
  :root[data-theme] {
    --bg: #fff;
    --panel: #fff;
    --card: #fff;
    --line: #d9d9d9;
    --ink: #1a1a1a;
    --body: #333;
    --sub: #555;
    --faint: #737373;
    --accent: #1a1a1a;
  }

  html,
  body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .site-header,
  .site-footer,
  .cv-noprint {
    display: none !important;
  }

  .wrap {
    padding: 0;
  }

  .cv-intro {
    margin-top: 0;
  }

  /* cards lose their shadow on paper — a hairline keeps the shape */
  .cv-now {
    border: 1px solid var(--line);
    box-shadow: none;
    margin-top: 24px;
  }

  /* paper is denser than screen: tighter section rhythm so the CV
     fits two pages instead of spilling two groups onto a third */
  .cv-stationen,
  .cv-skills {
    margin-top: 36px;
  }

  .cv-station {
    padding: 12px 0;
  }

  .cv-skills__list {
    gap: 14px;
  }

  /* entries stay on one page; section headings stay with their content.
     No forced page break before Skills anymore — with the real CV data
     the stations run long and the break left a mostly-empty page. */
  .cv-now,
  .cv-station,
  .cv-skillgroup {
    break-inside: avoid;
  }

  .cv-section-title {
    break-after: avoid;
  }
}

/* ---- responsive ---- */

@media (max-width: 600px) {
  .cv-intro {
    margin-top: 44px;
  }
}

@media (max-width: 480px) {
  .cv-intro {
    gap: 16px;
  }

  .cv-intro__portrait {
    width: 64px;
    height: 64px;
  }

  .cv-station,
  .cv-skillgroup {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .cv-station__period {
    padding-top: 0;
  }
}

/* ---- reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  .cv-gate__form.is-shaking,
  .cv-gate__avatar.is-shaking {
    animation: none;
  }
}
