:root {
  --ink: #161418;
  --muted: #746f77;
  --paper: #fbfaf8;
  --line: rgba(22, 20, 24, 0.11);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { background: transparent; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }

.widget-shell {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 64px);
}

.feed-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  text-decoration: none;
}

.avatar-mark {
  width: 0.72em;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #ffb42b, #f0296d, #8b3eea, #ffb42b);
  box-shadow: inset 0 0 0 0.16em var(--paper), 0 0 0 1px var(--line);
}

.filter-controls,
.filters {
  display: flex;
  align-items: center;
  gap: 4px;
}

.filters {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.filter {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.filter.is-active { color: white; background: var(--ink); }

.story-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  background: white;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.story-toggle.is-active {
  color: white;
  background: linear-gradient(135deg, #f0296d, #8b3eea);
}

.status {
  min-height: 280px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.status[hidden] { display: none; }

.spinner {
  width: 28px;
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: clamp(12px, 1.4vw, 20px);
}

.post-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 10px 30px rgba(22, 20, 24, 0.045);
  cursor: pointer;
}

.post-card.is-story { border-color: rgba(240, 41, 109, 0.42); }

.post-media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #e9e5e7;
  isolation: isolate;
  touch-action: pan-y;
}

.post-track {
  height: 100%;
  display: flex;
  transform: translateX(0);
  transition: transform 380ms cubic-bezier(.2,.75,.25,1);
  will-change: transform;
}

.post-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  padding: 0;
  color: white;
  background: #e9e5e7;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.post-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(10, 8, 12, 0.24), transparent 38%);
  opacity: 0;
  transition: opacity 220ms ease;
}

.post-slide img,
.post-slide video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #0e0d10;
}


.post-slide:hover::after,
.post-slide:focus-visible::after { opacity: 1; }

.media-badge,
.carousel-count {
  position: absolute;
  z-index: 4;
  top: 12px;
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: white;
  background: rgba(15, 12, 16, 0.72);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  font-weight: 700;
}

.media-badge { left: 12px; padding: 0; }
.media-badge::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid white;
}
.carousel-count { right: 12px; }

.story-badge {
  position: absolute;
  z-index: 5;
  left: 12px;
  bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #f0296d, #8b3eea);
  font-size: 0.72rem;
  font-weight: 700;
}

.carousel-button {
  position: absolute;
  z-index: 5;
  top: 50%;
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: white;
  background: rgba(15, 12, 16, 0.64);
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  font: 500 1.35rem/1 system-ui;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 180ms ease, background 180ms ease;
}

.carousel-button::before {
  content: "";
  width: 8px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
}
.carousel-button:hover,
.carousel-button:focus-visible { background: rgba(15, 12, 16, 0.88); }
.carousel-button.previous { left: 10px; }
.carousel-button.previous::before { margin-left: 3px; transform: rotate(135deg); }
.carousel-button.next { right: 10px; }
.carousel-button.next::before { margin-right: 3px; transform: rotate(-45deg); }
.post-media:hover .carousel-button,
.carousel-button:focus-visible { opacity: 1; }

.carousel-dots {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 12px;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgba(255,255,255,.55);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease;
}

.carousel-dot.is-active { width: 18px; border-radius: 999px; background: white; }

.post-meta {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 15px 15px;
}

.post-caption {
  width: 100%;
  max-height: 3.9em;
  overflow: hidden;
  display: -webkit-box;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.3;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.post-caption:hover,
.post-caption:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

.load-more {
  display: block;
  margin: 28px auto 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 20px;
  color: var(--ink);
  background: white;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.load-more[hidden] { display: none; }

.post-modal {
  --modal-viewport-height: var(--embed-visible-height, 100vh);
  --modal-max-height: min(92vh, calc(var(--modal-viewport-height) - 24px));
  width: min(1180px, calc(100% - 28px));
  max-width: none;
  max-height: var(--modal-max-height);
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  padding: 0;
  color: var(--ink);
  background: white;
  box-shadow: 0 28px 90px rgba(15, 12, 16, 0.28);
}

.post-modal.is-embedded-positioned {
  position: absolute;
  inset: auto 0 auto;
  top: calc(var(--embed-visible-top, 0px) + 12px);
  margin: 0 auto;
}

.post-modal::backdrop {
  background: rgba(15, 12, 16, 0.72);
  backdrop-filter: blur(5px);
}

.modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  max-height: var(--modal-max-height);
}

.modal-media {
  position: relative;
  min-width: 0;
  min-height: min(76vh, 760px, var(--modal-max-height));
  display: grid;
  place-items: center;
  overflow: hidden;
  background: white;
}

.modal-stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2vw, 28px);
}

.modal-stage img,
.modal-stage video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(var(--modal-max-height) - 40px);
  display: block;
  object-fit: contain;
  background: transparent;
}

.modal-details {
  position: relative;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(28px, 4vw, 52px) clamp(22px, 3vw, 40px);
  border-left: 1px solid var(--line);
}


.modal-caption {
  width: 100%;
  padding-right: 44px;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.modal-date {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.modal-original {
  margin-top: 28px;
  border-radius: 999px;
  padding: 11px 17px;
  color: white;
  background: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.modal-close,
.modal-nav {
  display: grid;
  place-items: center;
  border: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.modal-close {
  position: absolute;
  z-index: 8;
  top: 16px;
  right: 16px;
  width: 36px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.modal-close::before { transform: rotate(45deg); }
.modal-close::after { transform: rotate(-45deg); }

.modal-nav {
  position: absolute;
  z-index: 7;
  top: 50%;
  width: 40px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 4px 18px rgba(15, 12, 16, 0.14);
}

.modal-nav.previous { left: 16px; }
.modal-nav.next { right: 16px; }

.modal-nav::before {
  content: "";
  width: 9px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
}

.modal-nav.previous::before { margin-left: 3px; transform: rotate(135deg); }
.modal-nav.next::before { margin-right: 3px; transform: rotate(-45deg); }
.modal-nav[hidden],
.modal-count[hidden] { display: none; }

.modal-count {
  position: absolute;
  z-index: 7;
  right: 18px;
  bottom: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  color: white;
  background: rgba(15, 12, 16, 0.7);
  font-size: 0.72rem;
  font-weight: 700;
}

body:has(.post-modal[open]) { overflow: hidden; }
@media (max-width: 900px) {
  .post-card { border-radius: 15px; }
}

@media (max-width: 1100px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-modal {
    --modal-max-height: min(95vh, calc(var(--modal-viewport-height) - 16px));
    width: calc(100% - 16px);
    border-radius: 16px;
  }
  .post-modal.is-embedded-positioned { top: calc(var(--embed-visible-top, 0px) + 8px); }
  .modal-layout { grid-template-columns: 1fr; max-height: var(--modal-max-height); overflow-y: auto; }
  .modal-media { min-height: 0; height: min(56vh, 560px); }
  .modal-stage { padding: 10px; }
  .modal-stage img,
  .modal-stage video { max-height: calc(56vh - 20px); }
  .modal-details { overflow: visible; border-top: 1px solid var(--line); border-left: 0; padding: 24px 20px 28px; }
  .modal-close { top: 12px; right: 12px; }
}

@media (max-width: 620px) {
  .widget-shell { padding: 22px 12px 36px; }
  .feed-header { align-items: flex-start; flex-direction: column; }
  .gallery { grid-template-columns: 1fr; gap: 10px; }
  .filter-controls { width: 100%; flex-wrap: wrap; }
  .filters { flex: 1; }
  .filter { flex: 1; }
  .post-meta { min-height: 66px; padding: 11px 12px 12px; }
  .carousel-button { opacity: 1; width: 31px; }
  .carousel-count, .media-badge { top: 9px; }
  .media-badge { left: 9px; }
  .carousel-count { right: 9px; }
}

@media (hover: none) {
  .carousel-button { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}








