:root {
  font-size: 1.125rem;
  --bg0: #fff;
  --bg1: rgba(206, 206, 206, 0.5);
  --fg0: #000;
  --fg1: rgba(0, 0, 0, 0.5);
  --a0: #0076ff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg0: #000;
    --bg1: rgba(206, 206, 206, 0.125);
    --fg0: #fff;
    --fg1: rgba(206, 206, 206, 0.5);
    --a0: #0076ff;
  }
}
@media (min-width: 600px) {
  :root {
    font-size: 1.5rem;
  }
}
@media (min-width: 900px) {
  :root {
    font-size: 1.75rem;
  }
}
@media (min-width: 1200px) {
  :root {
    font-size: 2rem;
  }
}
*,
*:before,
*:after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body,
html {
  background: var(--bg0);
  color: var(--fg0);
}
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100vw;
  min-height: 100dvh;
  font-family:
    system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body.chat-root {
  overflow: hidden;
}
.messages {
  overflow: auto;
  width: 100%;
  max-width: 40rem;
  max-height: 100vh;
  padding: 1rem 0.9rem;
  margin: 0 auto;
  position: relative;
}

.messages::before {
  content: '';
  position: fixed;
  top: -40%;
  left: 50%;
  width: 140%;
  height: 80%;
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(
    ellipse 80% 50% at 50% 0%,
    rgba(0, 118, 255, 0.06) 0%,
    transparent 55%
  );
  animation: messages-glow 8s ease-in-out infinite;
  z-index: -1;
}

@media (prefers-color-scheme: dark) {
  .messages::before {
    background: radial-gradient(
      ellipse 80% 50% at 50% 0%,
      rgba(0, 118, 255, 0.12) 0%,
      transparent 55%
    );
  }
}

@keyframes messages-glow {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.02); }
}
.bubble {
  overflow: hidden;
  display: inline-block;
  margin: 0 0 0.125rem 0;
  padding: 0.5rem 0.85rem;
  line-height: 1.25rem;
  border-radius: 1.25rem;
  transform-origin: 0 100%;
  vertical-align: middle;
  transition:
    border-radius 0.25s ease-out 0.075s,
    transform 0.2s ease,
    box-shadow 0.25s ease;
}
.bubble.left.cornered {
  border-bottom-left-radius: 0;
}
.bubble.left {
  background: var(--bg1);
}

.bubble.right {
  background: var(--a0);
  color: #fff;
}
.bubble span {
  display: inline;
}
.bubble span.message {
  opacity: 0;
  line-height: 1.125;
}
.bubble a {
  display: inline-block;
  margin-top: 0.1rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--a0);
  text-decoration: none;
  font-size: 0.8em;
}

.bubble.right a {
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
}
.bubble .loading {
  position: absolute;
  white-space: pre;
  font-size: 1.625rem;
  line-height: 1rem;
}
.bubble .loading b {
  display: inline-block;
  color: var(--fg1);
}

.media-row {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.3rem;
  overflow-x: auto;
}

.media-thumb img {
  display: block;
  width: 6.5rem;
  height: 4.2rem;
  object-fit: cover;
  border-radius: 0.75rem;
}

.media-thumb video {
  display: block;
  width: 10rem;
  height: 5.6rem;
  object-fit: cover;
  border-radius: 0.75rem;
}

.photo-thumb {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.photo-thumb img {
  display: block;
  width: 6.5rem;
  height: 4.2rem;
  object-fit: cover;
  border-radius: 0.9rem;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 999;
}

.photo-viewer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.photo-viewer__content {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-viewer__image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 1.2rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85);
}

.photo-viewer__nav,
.photo-viewer__close {
  position: absolute;
  border: none;
  border-radius: 999px;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
}

.photo-viewer__nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
}

.photo-viewer__nav--prev {
  left: -3rem;
}

.photo-viewer__nav--next {
  right: -3rem;
}

.photo-viewer__close {
  top: -3rem;
  right: 0;
  font-size: 1.2rem;
}

@media (max-width: 600px) {
  .photo-viewer__nav--prev {
    left: 0.5rem;
  }

  .photo-viewer__nav--next {
    right: 0.5rem;
  }

  .photo-viewer__close {
    top: 1rem;
    right: 1rem;
  }
}

.thread-chip {
  margin-top: 0.25rem;
  margin-right: 0.3rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 0.75em;
  cursor: pointer;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease,
    background 0.2s ease;
}

.thread-chip:hover {
  transform: scale(1.06);
  background: rgba(0, 118, 255, 0.12);
  box-shadow: 0 0 20px rgba(0, 118, 255, 0.35);
}

.thread-chip:focus-visible {
  outline: 2px solid var(--a0);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .thread-chip:hover {
    background: rgba(0, 118, 255, 0.2);
    box-shadow: 0 0 24px rgba(0, 118, 255, 0.4);
  }
}

.photos-page {
  width: 100%;
  max-width: 26rem;
  padding: 1.5rem 1.2rem 3rem;
  margin: 0 auto;
}

.photos-header {
  margin-bottom: 1.5rem;
}

.photos-header h1 {
  font-size: 1.3rem;
  margin-bottom: 0.35rem;
}

.photos-info {
  font-size: 0.9rem;
  color: var(--fg1);
}

.photos-section {
  margin-bottom: 1.75rem;
}

.photos-section h2 {
  font-size: 0.95rem;
  color: var(--fg1);
  margin-bottom: 0.6rem;
}

.photos-main {
  width: 100%;
  max-width: 26rem;
}

.photos-main-frame {
  position: relative;
  width: 100%;
  border-radius: 1.2rem;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85);
  height: 70vh;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photos-main-image {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
  border-radius: 1.2rem;
  transition:
    opacity 0.25s ease,
    transform 0.3s ease;
  opacity: 0;
  transform: scale(0.985);
}

.photos-main-nav {
  position: static;
  border: none;
  border-radius: 999px;
  width: 2.4rem;
  height: 2.4rem;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.photos-main-nav--prev {
}

.photos-main-nav--next {
}

.photos-main-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (max-width: 600px) {
  .photos-main-frame {
    border-radius: 1rem;
  }
}

.work-page {
  width: 100%;
  max-width: 28rem;
  padding: 1.5rem 1.2rem 3rem;
  margin: 0 auto;
}

.work-header {
  margin-bottom: 1.5rem;
}

.photos-back {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--a0);
  text-decoration: none;
  font-size: 0.9rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.photos-back:hover {
  opacity: 0.85;
  transform: translateX(-2px);
}

.work-header h1 {
  font-size: 1.3rem;
  margin-bottom: 0.35rem;
  text-transform: lowercase;
}

.work-header p {
  font-size: 0.9rem;
  color: var(--fg1);
  text-transform: lowercase;
}

.work-card {
  margin-bottom: 1.3rem;
  border-radius: 1.2rem;
  background: #000;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transition:
    opacity 0.4s ease,
    transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.work-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 320px;
  object-fit: cover;
}

.work-card-body {
  padding: 0.75rem 0.9rem 0.9rem;
}

.work-card-body h2 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  text-transform: lowercase;
}

.work-card-body p {
  font-size: 0.85rem;
  color: var(--fg1);
  text-transform: lowercase;
}

.work-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
