/* Copyright (C) 2026 Christof Donat */
/* SPDX-License-Identifier: AGPL-3.0-or-later */

@font-face {
  font-family: "InterVariable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
}
@font-face {
  font-family: "InterVariable";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/InterVariable-Italic.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --accent: #1a6b72;
  --muted:       color-mix(in srgb, CanvasText 55%, Canvas);
  --line:        color-mix(in srgb, CanvasText 16%, Canvas);
  --surface:     color-mix(in srgb, CanvasText 5%, Canvas);
  --chip-bg:     color-mix(in srgb, var(--accent) 12%, Canvas);
  --chip-border: color-mix(in srgb, var(--accent) 32%, Canvas);
  --col: 1500px;
}
@media (prefers-color-scheme: dark) {
  :root { --accent: #4cb6bd; }
}

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

body {
  margin: 0;
  background: Canvas;
  color: CanvasText;
  font-family: "InterVariable", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--col);
  margin-inline: auto;
  padding: 1rem 1.25rem;
}
.masthead-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: CanvasText;
}
.masthead-brand:hover { text-decoration: none; }
.masthead-logo { width: 28px; height: 28px; }
.masthead-name { font-weight: 700; letter-spacing: -.01em; }
.masthead-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.column {
  max-width: var(--col);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.profile {
  padding-bottom: 4rem;
  container-type: inline-size;
}
.header {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  border-radius: 14px;
  background: var(--surface);
}

.profile-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
}
.avatar {
  width: clamp(96px, 12cqw, 200px);
  height: clamp(96px, 12cqw, 200px);
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--surface);
}
.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--accent);
  background: var(--chip-bg);
}

.identity {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 1rem;
  row-gap: .2rem;
}
.identity .p-name { grid-column: 1 / -1; grid-row: 1; margin: 0; font-size: clamp(1.5rem, 1.1rem + 1.6cqw, 2.2rem); font-weight: 700; line-height: 1.2; }
.identity .acct   { grid-column: 1; grid-row: 2; margin: 0; }
.identity .acct a { color: var(--muted); }
.identity .joined { grid-column: 2; grid-row: 2; margin: 0; justify-self: end; color: var(--muted); font-size: .85rem; }
.counts {
  grid-column: 1 / -1; grid-row: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin: .35rem 0 0;
}
.counts > div { display: flex; gap: .3rem; }
.counts dt { font-weight: 700; }
.counts dd { margin: 0; color: var(--muted); }

.note { margin: 1.25rem 0 0; }
.note p { margin: .5rem 0; }

.resume h2,
.posts h2 {
  margin: 2rem 0 .25rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--line);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
}
.h-event {
  display: grid;
  grid-template-columns: 9rem 1fr;
  column-gap: 1.5rem;
  row-gap: .15rem;
  align-items: start;
  margin-top: 1.1rem;
}
.h-event > :not(.dates) { grid-column: 2; }
.h-event .dates { grid-column: 1; grid-row: 1; margin: 0; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.h-event p:has(.p-name)  { font-weight: 400; margin: 0; color: var(--muted); }
.h-event .p-name { margin: 0; font-weight: 600; color: CanvasText; }
.h-event .p-location { font-weight: 400; color: var(--muted); }
.h-event .p-summary { margin: .15rem 0 0; }
.h-event .u-url { font-size: .9rem; word-break: break-word; }

.job-projects { list-style-type: disc; padding: 0; margin: .3rem 1rem 0; font-size: .9rem; }
.job-projects li { color: var(--muted); }

.skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 0;
  margin: .7rem 0 0;
}
.p-skill {
  padding: .25rem .7rem;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  background: var(--chip-bg);
  font-size: .85rem;
}

.status { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.status:first-of-type { border-top: 0; }
.e-content :first-child { margin-top: 0; }
.e-content p { margin: .4rem 0; }
.status-meta {
  display: flex;
  gap: 1.1rem;
  margin-top: .6rem;
  color: var(--muted);
  font-size: .85rem;
}
.posts .empty { color: var(--muted); }

.author {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
  color: CanvasText;
}
.author .avatar { width: 36px; height: 36px; font-size: .8rem; }
.author .acct { color: var(--muted); font-size: .9rem; }

.status-head { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: .5rem; }
.status-head .author { margin-bottom: 0; align-items: flex-start; }
.status-head .avatar-wrap { position: relative; display: inline-flex; flex: none; }
.status-head .names { display: inline-flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.status-head .names .p-name { font-weight: 600; }
.booster-badge {
  position: absolute; right: -4px; bottom: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid Canvas; object-fit: cover;
}
.status-side { margin-left: auto; display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.status-side .permalink { color: var(--muted); }

.status-head.meta-only { margin-bottom: .3rem; }
.status-head.meta-only .status-side { margin-left: 0; }

.boost-head, .reply-head { margin: 0 0 .3rem; color: var(--muted); font-size: .85rem; }
.boost-head .boost-who, .reply-head .reply-who { color: CanvasText; font-weight: 600; }

.actions { display: flex; align-items: center; gap: .3rem; margin-top: .6rem; }
.actions .action {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .5rem; border: 1px solid transparent; border-radius: 999px;
  background: none; color: var(--muted); font: inherit; font-size: .95rem; line-height: 1; cursor: pointer;
}
.actions .action:hover { border-color: var(--line); color: CanvasText; }
.actions .action .count { font-size: .8rem; }
.actions .action svg { display: block; }
.visibility svg { display: block; }
.actions .action.menu { margin-left: auto; }

@media (max-width: 480px) {
  .identity { grid-template-columns: 1fr; }
  .identity .joined { grid-column: 1; grid-row: auto; justify-self: start; }
  .h-event { grid-template-columns: 1fr; }
  .h-event > :not(.dates) { grid-column: 1; }
  .h-event .dates { grid-column: 1; grid-row: auto; order: -1; }
}


.follow-button {
  font: inherit;
  margin-top: 0.5rem;
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: Canvas;
  cursor: pointer;
}
.follow-button.is-following,
.follow-button.is-requested {
  background: transparent;
  color: var(--accent);
}

.follow-button:disabled { opacity: 0.6; cursor: default; }

.compose-reply-target:not([hidden]) {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .5rem;
  background: var(--surface);
  border-left: 2px solid var(--accent);
  border-radius: 6px;
  font-size: .85rem;
  color: var(--muted);
}
.compose-reply-target-name { font-weight: 600; flex: none; }
.compose-reply-target-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compose .compose-reply-clear { border: none; background: none; border-radius: 0; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }

.compose { display: grid; gap: .6rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.compose textarea {
  width: 100%;
  padding: .6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: CanvasText;
  font: inherit;
  resize: vertical;
}
.compose textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.compose button {
  justify-self: end;
  padding: .4rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: Canvas;
  font: inherit;
  cursor: pointer;
}

.e-content.not-expandable,
.e-content.expandable {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  line-clamp: 8;
  overflow: hidden;
}
.e-content.expandable { position: relative; }
.e-content.expandable::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3em;
  background: linear-gradient(to bottom, transparent, Canvas);
  pointer-events: none;
}
.show-more, .show-less {
  display: none;
  margin-top: .3rem; padding: 0;
  background: none; border: none;
  color: var(--accent); font: inherit; cursor: pointer;
}
.show-more:hover, .show-less:hover { text-decoration: underline; }
.e-content.expandable ~ .show-more { display: inline-block; }
.e-content.collapsable ~ .show-less { display: inline-block; }

.thread.multipart .thread-body { margin-left: 17px; padding-left: 1.4rem; border-left: 2px solid var(--line); }
.thread .thread-part { padding-top: .7rem; }
.thread .thread-part + .thread-part { margin-top: .7rem; }
.thread .thread-part .part-content :first-child { margin-top: 0; }
.thread .thread-part .part-content p { margin: .4rem 0; }
.thread .boosted-part { position: relative; }
.thread .boosted-part::before { content: ""; position: absolute; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.thread:not(.multipart) .boosted-part { padding-left: .7rem; }
.thread:not(.multipart) .boosted-part::before { left: 0; }
.thread.multipart .boosted-part::before { left: -.7rem; }
.thread-body.not-expandable,
.thread-body.expandable { max-height: 22em; overflow: hidden; }
.thread-body.expandable { position: relative; }
.thread-body.expandable::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3em;
  background: linear-gradient(to bottom, transparent, Canvas);
  pointer-events: none;
}
.thread-body.expandable ~ .show-more { display: inline-block; }
.thread-body.collapsable ~ .show-less { display: inline-block; }

.conversations-layout {
  --masthead-space: 6rem;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
  height: calc(100dvh - var(--masthead-space));
}
 
.conversations { overflow-y: auto; border-right: 1px solid var(--line); }
.conversations-title { margin: 0; padding: .6rem .75rem; font-size: 1.1rem; }
 
.conversation {
  display: flex;
  gap: .65rem;
  align-items: center;
  min-height: 60px;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--line);
  color: CanvasText;
  text-decoration: none;
}
.conversation:hover { background: var(--surface); }
.conversation.active { background: var(--chip-bg); }
 
.conversation-avatars { flex: none; position: relative; width: 64px; height: 56px; }
.conversation-avatar { position: absolute; border: 2px solid Canvas; border-radius: 50%; box-sizing: border-box; }
.conversation-avatar:nth-child(1) { z-index: 3; }
.conversation-avatar:nth-child(2) { z-index: 2; }
.conversation-avatar:nth-child(3) { z-index: 1; }
.conversation-avatars--1 .conversation-avatar { width: 56px; height: 56px; top: 0; left: 4px; font-size: 1.1rem; }
.conversation-avatars--2 .conversation-avatar { width: 40px; height: 40px; font-size: .8rem; }
.conversation-avatars--2 .conversation-avatar:nth-child(1) { top: 16px; left: 0; }
.conversation-avatars--2 .conversation-avatar:nth-child(2) { top: 0; left: 24px; }
.conversation-avatars--3 .conversation-avatar { width: 38px; height: 38px; font-size: .72rem; }
.conversation-avatars--3 .conversation-avatar:nth-child(1) { top: 18px; left: 0; }
.conversation-avatars--3 .conversation-avatar:nth-child(2) { top: 18px; left: 26px; }
.conversation-avatars--3 .conversation-avatar:nth-child(3) { top: 0; left: 13px; }
.conversation-avatar--more { background: var(--chip-bg); color: var(--muted); font-weight: 600; }
 
.conversation-participants {
  display: none;
  position: absolute;
  top: calc(100% - .3rem);
  left: 0;
  z-index: 20;
  background: Canvas;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  padding: .4rem .55rem;
  font-size: .82rem;
  white-space: nowrap;
}
.conversation-avatars:hover .conversation-participants { display: block; }
.conversation-participants span { display: block; padding: .1rem 0; }
 
.conversation-body { min-width: 0; flex: 1; }
.conversation-accounts { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.conversation.unread .conversation-accounts::after { content: " •"; color: var(--accent); }
.conversation-preview {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conversation-time { color: var(--muted); font-size: .8rem; }
 
.conversation-view { display: flex; flex-direction: column; min-width: 0; }
.conversation-head { padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.conversation-head .back { display: none; }
.conversation-messages { padding: .75rem; display: flex; flex-direction: column; flex: 1; overflow-y: auto; min-height: 0; }
 
.msg { display: flex; gap: .5rem; align-items: flex-start; margin-top: .5rem; }
.msg--run-cont { margin-top: .12rem; }
.msg--own { flex-direction: row-reverse; }
 
.msg-avatar { flex: none; width: 36px; }
.msg-avatar .avatar { width: 36px; height: 36px; }
.msg-avatar .avatar-fallback { font-size: .8rem; }
 
.msg-stack { display: flex; flex-direction: column; gap: .15rem; max-width: 72%; min-width: 0; }
.msg-name { padding-inline: .25rem; font-size: .85rem; color: var(--muted); }
 
.msg-bubble {
  padding: .45rem .7rem;
  border-radius: 16px;
  background: var(--surface);
  overflow-wrap: break-word;
  position: relative;
}
.msg-actions {
  position: absolute;
  top: -16px;
  right: 8px;
  display: flex;
  gap: 2px;
  padding: 2px 4px;
  background: color-mix(in srgb, Canvas 82%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
  opacity: 0;
  transition: opacity .12s;
}
.msg:hover .msg-actions { opacity: 1; }
.msg--own .msg-actions { right: auto; left: 8px; }
.msg-action {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 999px;
  opacity: .55;
  transition: opacity .12s, background .12s, color .12s;
}
.msg-action:disabled { opacity: .3; cursor: default; }
.msg-action:hover:not(:disabled) { opacity: 1; background: var(--surface); color: var(--accent); }
.msg--other .msg-bubble { border-top-left-radius: 5px; }
.msg--own .msg-bubble { background: var(--chip-bg); border-top-right-radius: 5px; }
.msg-bubble p { margin: .3rem 0; }
.msg-bubble :first-child { margin-top: 0; }
.msg-bubble :last-child { margin-bottom: 0; }

.msg-reply {
  display: flex;
  align-items: center;
  gap: .3rem;
  min-width: 180px;
  font-size: .78rem;
  color: var(--muted);
  padding: .1rem .4rem;
  border-left: 2px solid var(--accent);
}
.msg--own .msg-reply { border-left: 0; border-right: 2px solid var(--accent); }
.msg-reply .avatar { width: 18px; height: 18px; font-size: .55rem; flex: none; }
.msg-reply-name { font-weight: 600; flex: none; }
.msg-reply-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.conversation-compose {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .5rem .75rem;
  border-top: 1px solid var(--line);
}
.conversation-reply-target:not([hidden]) {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .5rem;
  background: var(--surface);
  border-left: 2px solid var(--accent);
  border-radius: 6px;
  font-size: .8rem;
  color: var(--muted);
}
.conversation-reply-target-name { font-weight: 600; flex: none; }
.conversation-reply-target-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-reply-clear { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.conversation-compose-row { display: flex; gap: .5rem; align-items: flex-end; }
.conversation-input {
  flex: 1;
  min-width: 0;
  padding: .5rem .75rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: Canvas;
  color: CanvasText;
  font: inherit;
  resize: none;
}
.conversation-send {
  padding: .5rem 1rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: Canvas;
  cursor: pointer;
}
 
@media (max-width: 720px) {
  .conversations-layout { grid-template-columns: 1fr; height: auto; }
  .conversations { border-right: none; }
  .conversations-layout--list .conversation-view { display: none; }
  .conversations-layout--view .conversations { display: none; }
  .conversation-head .back { display: inline; }
}

