/* Portfolio-Bausteine: Startseite, Now, Weg, Über mich, Zusammenarbeit,
   Badges/Filter/Kontakt (components/Portfolio.tsx). Lädt auf jeder Seite
   nach chrome.css; Content-Seiten laden zusätzlich content.css. */

/* ---------- Wortmarke im Header ---------- */

header.nav .brand,
.mobile-menu .mm-head .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.brand-name {
  font-family: var(--f-display);
  font-size: 21px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
footer.site-footer .col span {
  display: block;
  color: var(--ink-soft);
  font-size: 13px;
  margin-bottom: 6px;
}

/* ---------- Gemeinsame Bausteine ---------- */

.muted {
  color: var(--ink-soft);
}
.small {
  font-size: 13px;
}
.text-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}
.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sec-head {
  margin-bottom: 32px;
}
.sec-label {
  display: block;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.sec-head h2 {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: var(--d-track);
  margin: 0;
  max-width: 22ch;
}
.sec-lede {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 16px 0 0;
}

.badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.badge {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
}
.badge.milestone {
  border-color: var(--accent);
  color: var(--accent);
}

.post-list .meta {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.filters {
  display: grid;
  gap: 10px;
  margin: -16px 0 32px;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-block;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  transition: border-color .15s, color .15s;
}
a.chip:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* Studium · Job · Firma: drei Karten, die von einer gemeinsamen Linie
   abzweigen. Linie und Stiele im Verlauf des Navbar-CTAs. */
.paths-now {
  --pn-line: linear-gradient(90deg, #8B5CF6, #60A5FA);
  margin-top: 32px;
}
.paths-now ul {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 24px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
/* waagrechte Linie von der Mitte der ersten bis zur Mitte der letzten Karte */
.paths-now ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc((100% - 24px) / 6);
  right: calc((100% - 24px) / 6);
  height: 2px;
  border-radius: 2px;
  background: var(--pn-line);
}
.paths-now li {
  position: relative;
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--rule);
  background: var(--card);
  transition: transform .2s, border-color .2s;
}
.paths-now li:hover {
  transform: translateY(-2px);
  border-color: var(--rule-strong);
}
/* senkrechter Stiel von der Linie zur Karte */
.paths-now li::before {
  content: "";
  position: absolute;
  top: -24px;
  left: 50%;
  width: 2px;
  height: 24px;
  margin-left: -1px;
  background: #7c7ff8;
}
.paths-now li:first-child::before {
  background: #8B5CF6;
}
.paths-now li:last-child::before {
  background: #60A5FA;
}
.pn-kind {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.pn-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
}
.pn-place {
  font-size: 13px;
  color: var(--ink-soft);
}
@media (max-width: 700px) {
  /* Mobil: Pfade zweigen senkrecht von einer Linie links ab */
  .paths-now ul {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 0 0 22px;
    gap: 10px;
  }
  .paths-now ul::before {
    top: 12px;
    bottom: 26px;
    left: 3px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, #8B5CF6, #60A5FA);
  }
  .paths-now li::before {
    top: 50%;
    left: -19px;
    width: 19px;
    height: 2px;
    margin: -1px 0 0;
  }
}

.prose.compact p {
  margin: 0 0 10px;
}

.page-section {
  margin-top: 88px;
}

/* ---------- Kontakt ---------- */

.contact-block {
  margin-top: 88px;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--rule);
}
.contact-block h2 {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.08;
  letter-spacing: var(--d-track);
  margin: 0;
  max-width: 24ch;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.contact-mail {
  margin: 16px 0 0;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-mute);
}

/* ---------- Startseite ---------- */

main.home {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 max(clamp(18px, 4vw, 34px), env(safe-area-inset-left)) 120px;
}
/* Hero: Entscheidungsbaum als Bühne, Text blendet darüber ein.
   Ablauf (nur mit .anim, gesetzt per HeroScript in Portfolio.tsx):
   1. Äste wachsen Ebene für Ebene von oben nach unten (--step je Ebene)
   2. der gewählte Pfad leuchtet von der Wurzel bis „jetzt“ auf
   3. .revealed: Baum tritt zurück, Text blendet gestaffelt ein
   Ohne JS / .instant: sofort Endzustand. */
.hero {
  --step: .42s;
  position: relative;
  display: grid;
  align-items: center;
  justify-items: start;
  min-height: calc(100svh - 90px);
  padding: clamp(40px, 7vw, 80px) 0;
  isolation: isolate;
}
.tree {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.tree-tall {
  display: none;
}
@media (max-width: 700px) {
  .tree-wide {
    display: none;
  }
  .tree-tall {
    display: block;
  }
  .tree-tall .leaf text {
    font-size: 17px;
  }
  .hero {
    align-items: end;
  }
  .hero-fade {
    background: linear-gradient(
      0deg,
      var(--bg) 0%,
      var(--bg) 62%,
      color-mix(in srgb, var(--bg) 0%, transparent) 92%
    );
  }
  .tree-tall {
    transition: opacity 1s ease;
  }
  .hero.revealed .tree-tall {
    opacity: .16;
  }
}
.tree path {
  fill: none;
  stroke-linecap: round;
}
.tree-base {
  opacity: .5;
  transition: opacity 1s ease;
}
.hero.anim:not(.revealed) .tree-base {
  opacity: 1;
}
.tree .branch {
  stroke: var(--ink-mute);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw .5s ease-out forwards;
}
.tree .node,
.tree .leaf {
  opacity: 0;
  animation: appear .3s ease-out forwards;
}
.tree .node {
  fill: var(--bg);
  stroke: var(--ink-mute);
  stroke-width: 2;
}
.tree .node.root {
  fill: var(--ink-mute);
}
.tree .leaf circle {
  fill: var(--bg);
  stroke: var(--ink-mute);
  stroke-width: 2;
}
.tree .leaf text {
  font-family: var(--f-mono);
  font-size: 20px;
  letter-spacing: .04em;
  fill: var(--ink-soft);
}
.tree .d1 {
  animation-delay: calc(var(--step) * 1);
}
.tree .d2 {
  animation-delay: calc(var(--step) * 2);
}
.tree .d3 {
  animation-delay: calc(var(--step) * 3);
}
.tree .d4 {
  animation-delay: calc(var(--step) * 4);
}
/* Gabelung erscheint, sobald der Ast davor angekommen ist */
.tree .node.d1 {
  animation-delay: calc(var(--step) * 1 - .05s);
}
.tree .node.d2 {
  animation-delay: calc(var(--step) * 2 - .05s);
}
.tree .node.d3 {
  animation-delay: calc(var(--step) * 3 - .05s);
}
.tree-chosen {
  stroke: var(--accent);
  stroke-width: 4;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: .8;
  animation: draw 1.1s cubic-bezier(.65, 0, .35, 1) forwards;
  animation-delay: calc(var(--step) * 4 + .2s);
  transition: opacity 1s ease;
}
.tree-chosen-end {
  fill: var(--accent);
  opacity: 0;
  animation: appear-chosen .4s ease-out forwards;
  animation-delay: calc(var(--step) * 4 + 1.2s);
}
.hero.anim:not(.revealed) .tree-chosen {
  opacity: 1;
}
.tree .leaf.chosen text {
  fill: var(--accent);
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes appear {
  to {
    opacity: 1;
  }
}
@keyframes appear-chosen {
  to {
    opacity: .8;
  }
}

/* Text: blendet links über dem Baum ein, ein Verlauf („Fade“) legt sich
   dafür über die linke Hälfte, der Baum gleitet nach rechts. */
.hero-fade {
  position: absolute;
  inset: 0 -40px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    var(--bg) 0%,
    var(--bg) 34%,
    color-mix(in srgb, var(--bg) 0%, transparent) 70%
  );
  transition: opacity 1s ease;
}
.hero.anim:not(.revealed) .hero-fade {
  opacity: 0;
}
.tree {
  transition: transform 1.2s cubic-bezier(.65, 0, .35, 1);
}
.hero.revealed .tree-wide {
  transform: translateX(22%) scale(.84);
}
.hero-text {
  position: relative;
  max-width: 640px;
}
.hero-text > * {
  transition: opacity .8s ease, transform .8s ease;
}
.hero.anim:not(.revealed) .hero-text > * {
  opacity: 0;
  transform: translateY(14px);
}
.hero.revealed .hero-text > :nth-child(1) {
  transition-delay: .3s;
}
.hero.revealed .hero-text > :nth-child(2) {
  transition-delay: .7s;
}
.hero.revealed .hero-text > :nth-child(3) {
  transition-delay: 1.05s;
}
.hero.revealed .hero-text > :nth-child(n + 4) {
  transition-delay: 1.35s;
}
.hero.instant *,
.hero.instant .hero-text > * {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition: none !important;
}

.hero h1 {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  font-size: clamp(44px, 6.4vw, 82px);
  line-height: .98;
  letter-spacing: var(--d-track);
  margin: 0 0 28px;
}
.hero .philosophy {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0;
}
.hero .thesis {
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.45;
  font-weight: 500;
  max-width: 40ch;
  margin: 20px 0 0;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.band {
  padding: clamp(56px, 8vw, 96px) 0 0;
}

.theme-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}
.theme-item {
  display: grid;
  gap: 8px;
  height: 100%;
  padding: 24px;
  background: var(--bg);
  transition: background .15s;
}
a.theme-item:hover {
  background: var(--card);
}
.theme-title {
  font-family: var(--f-display);
  font-size: 21px;
  letter-spacing: -0.02em;
}
.theme-desc {
  font-size: 14px;
  color: var(--ink-soft);
}

.project-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.project-card {
  display: block;
  height: 100%;
  padding: 14px 14px 22px;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--card);
  transition: border-color .15s, transform .15s;
}
.project-card:hover {
  border-color: var(--rule-strong);
  transform: translateY(-2px);
}
.project-card img,
.project-cover-fallback {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 16px;
}
.project-cover-fallback {
  background:
    radial-gradient(circle at 30% 30%, rgba(139, 92, 246, .22), transparent 60%),
    radial-gradient(circle at 75% 70%, rgba(96, 165, 250, .22), transparent 60%),
    var(--bg-2);
}
.project-card h3 {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 4px 0 8px;
}
.project-card p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  /* Lange Beschreibungen in der Karte kürzen, voller Text auf der Detailseite */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}

/* ---------- /weg: git log ---------- */

.gitlog {
  list-style: none;
  padding: 0 0 0 28px;
  margin: 0;
  position: relative;
}
.gitlog::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--rule-strong);
}
.gitlog > li {
  position: relative;
  padding-bottom: 40px;
}
.gitlog > li::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--ink-mute);
}
.gitlog > li.kind-milestone::before,
.gitlog > li.gitlog-head::before {
  background: var(--accent);
  border-color: var(--accent);
}
.gitlog-head {
  font-family: var(--f-mono);
  font-size: 12px;
  display: flex;
  gap: 12px;
  padding-bottom: 32px !important;
}
.gitlog-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  font-family: var(--f-mono);
  font-size: 12px;
}
.gitlog .hash {
  color: var(--accent);
}
.gitlog .scope {
  color: var(--ink);
}
.gitlog .when {
  color: var(--ink-mute);
}
.gitlog-entry h2 {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 8px 0 6px;
}
.gitlog-entry p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 62ch;
}
.gitlog-entry .text-link {
  margin-top: 8px;
}

/* ---------- /ueber-mich ---------- */

.about-intro {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
}
.portrait {
  width: 100%;
  height: auto;
  border-radius: 14px;
  filter: grayscale(.15);
}
.about-intro p.page-lede {
  margin-bottom: 16px;
}
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.skill-card {
  padding: 24px;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--card);
}
.skill-card h3 {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  font-size: 22px;
  margin: 0 0 14px;
}
.chips {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.evidence {
  font-size: 14px;
}
.evidence a {
  color: var(--accent);
}
.principles {
  list-style: none;
  counter-reset: p;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 40px;
}
.principles li {
  counter-increment: p;
}
.principles li::before {
  content: "0" counter(p);
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--accent);
}
.principles h3 {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  font-size: 24px;
  margin: 6px 0 8px;
}
.principles p {
  margin: 0;
  color: var(--ink-soft);
}
.books-sub {
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 28px 0 12px;
}
.books {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.books li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 4px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.book-title {
  font-weight: 500;
}
.book-author {
  grid-column: 1;
  font-size: 13px;
  color: var(--ink-mute);
}
.book-note {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--ink-soft);
}

.certs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  border-top: 1px solid var(--rule);
}
.certs li {
  display: grid;
  gap: 2px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.cert-title {
  font-weight: 500;
}
.cert-meta {
  font-size: 13px;
  color: var(--ink-mute);
}
.cert-link {
  font-size: 13px;
  color: var(--accent);
}
@media (max-width: 760px) {
  .certs {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- /zusammenarbeit ---------- */

.offers {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.offer {
  padding: 28px 24px;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--card);
}
.offer h2 {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.offer dl {
  margin: 0;
}
.offer dt {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 16px;
}
.offer dd {
  margin: 4px 0 0;
  color: var(--ink-soft);
}
.offer dd a {
  color: var(--accent);
}
.steps {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
  font-size: 17px;
}
.steps li::marker {
  font-family: var(--f-mono);
  color: var(--accent);
}
.capacity h2 {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  font-size: 28px;
  margin: 0 0 10px;
}
.capacity p {
  max-width: 62ch;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  header.nav .links {
    gap: 18px;
  }
  .theme-grid,
  .project-grid,
  .offers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .about-intro,
  .skill-grid,
  .principles {
    grid-template-columns: minmax(0, 1fr);
  }
  .about-intro .portrait {
    max-width: 200px;
  }
  .theme-grid,
  .project-grid,
  .offers {
    grid-template-columns: minmax(0, 1fr);
  }
  .books li {
    grid-template-columns: minmax(0, 1fr);
  }
  .book-note {
    grid-column: 1;
    grid-row: auto;
  }
  .post-list .meta {
    justify-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tree .branch,
  .tree-chosen {
    animation: none;
    stroke-dashoffset: 0;
  }
  .tree .node,
  .tree .leaf {
    animation: none;
    opacity: 1;
  }
  .tree-chosen-end {
    animation: none;
    opacity: .6;
  }
}

/* ---------- Beitrags-Inhalte (CMS-HTML) ---------- */

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}
.prose th,
.prose td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.prose th {
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.prose figure {
  margin: 28px 0;
}
.prose figure img,
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}
.prose figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-mute);
}
@media (max-width: 680px) {
  .prose table {
    display: block;
    overflow-x: auto;
  }
}

/* Karten heben sich im Light Mode per Schatten vom fast weißen Grund ab
   (--card-shadow ist im Dark Mode none). */
.project-card,
.skill-card,
.offer,
.contact-block,
.paths-now li {
  box-shadow: var(--card-shadow);
}
